'use strict'
const mongoose = require('mongoose')

// 创建schema
const TopicComment = new mongoose.Schema({
    
    content: { type: String, default: "" },
    fromId: { type: mongoose.Schema.Types.ObjectId, ref: "user" },
    toId: { type: mongoose.Schema.Types.ObjectId, ref: "user" },
    topicId:{type: mongoose.Schema.Types.ObjectId, ref: "topic"},
    created: { type: Number, default:new Date().getTime() },

})

//  创建model
const topicCommentModel = mongoose.model('topicComment', TopicComment, 'topicComment') // newClass为创建或选中的集合

module.exports = topicCommentModel